/*
 * testclient.h
 *
 *  Created on: Apr 20, 2011
 *      Author: Alan Mattila
 */

#ifndef TESTCLIENT_H_
#define TESTCLIENT_H_

#include <QtGui>
#include <QtCore>

#include <QMainWindow>
#include <QPushButton>

#include "../../../board/Board.h"
#include "../../NetworkClient.h"

#define HOSTNAME "127.0.0.1"

using std::string;

class testclient : public QMainWindow
{
	Q_OBJECT

public:
	testclient(QWidget *parent);
	testclient(QWidget *parent, string hn);
	~testclient();

private:
	NetworkClient *client;
	Board *board;
	string hostname;

	QTcpSocket *tcpSocket;
	QPushButton *actionConnect;
	QPushButton *actionClose;
	QPushButton *moveButton;

	void initWindow(void);

private slots:
	void ConnectToServer(void);
	void Close(void);
	void Disconnected(void);
	void HandleMessage(packetMessage_t);
	void HandleGameBoard(void);
	void TestMove(void);
};

#endif /* TESTCLIENT_H_ */
